package com.mp3.player.tests
{
	import com.mp3.player.vos.Track;
	import com.mp3.player.vos.TrackList;
	
	import flash.trace.Trace;
	
	import mx.preloaders.Preloader;

	public class TrackListTest
	{
		private var trackList: TrackList = new TrackList();
		
		public function TrackListTest()
		{
			var length: int = 100;
			
			for (var i: int = 0; i < length; i++)
			{
				var track: Track = new Track();
				trackList.addTrack(track);
			}
			
			test7();
		}
		
		private function test1(): void
		{
			for (var i: int = 0; i < 200; i++)
			{
				trackList.next();
				var track: Track = trackList.selectedTrack;
				
				if (track)
				{
					trace(track.index);
				}
				else
				{
					trace(null);
				}
			}
		}
		
		private function test2(): void
		{
			trackList.repeat = true;
			for (var i: int = 0; i < 200; i++)
			{
				trackList.next();
				var track: Track = trackList.selectedTrack;
				
				if (track)
				{
					trace(track.index);
				}
				else
				{
					trace(null);
				}
			}
		}
		
		private function test3(): void
		{
			trackList.shuffle = true;
			for (var i: int = 0; i < 200; i++)
			{
				trackList.next();
				var track: Track = trackList.selectedTrack;
				
				if (track)
				{
					trace(track.index);
				}
				else
				{
					trace(null);
				}
			}
		}
		
		private function test4(): void
		{
			trackList.shuffle = true;
			trackList.repeat = true;
			for (var i: int = 0; i < 200; i++)
			{
				trackList.next();
				var track: Track = trackList.selectedTrack;
				
				if (track)
				{
					trace(track.index);
				}
				else
				{
					trace(null);
				}
			}
		}
		
		
		private function test5(): void
		{
			for (var i: int = 0; i < 200; i++)
			{
				trackList.prev()
				var track: Track = trackList.selectedTrack;
				
				if (track)
				{
					trace(track.index);
				}
				else
				{
					trace(null);
				}
			}
		}
		
		private function test6(): void
		{
			trackList.repeat = true;
			
			for (var i: int = 0; i < 200; i++)
			{
				trackList.prev()
				var track: Track = trackList.selectedTrack;
				
				if (track)
				{
					trace(track.index);
				}
				else
				{
					trace(null);
				}
			}
		}
		
		private function test7(): void
		{
			trackList.shuffle = true;
			
			for (var i: int = 0; i < 200; i++)
			{
				trackList.prev()
				var track: Track = trackList.selectedTrack;
				
				if (track)
				{
					trace(track.index);
				}
				else
				{
					trace(null);
				}
			}
		}
		
		
	}
}